#include<stdlib.h>
#include<iup.h>

int btn_exit_cb(Ihandle *self){
	return IUP_CLOSE;
}

int main(int argc, char **argv){
	Ihandle *dlg, *button, *label, *vbox;
	IupOpen(&argc, &argv);
	label = IupLabel("Hello from iup");
	button = IupButton("Ok", NULL);
	vbox = IupVbox(label, button, NULL);
	
	IupSetAttribute(vbox, "ALIGMENT", "ACENTER");
	IupSetAttribute(vbox, "GAP", "10");
	IupSetAttribute(vbox, "MARGIN", "10x10");
	
	dlg = IupDialog(vbox);
	
	IupSetAttribute(dlg, "TITLE", "5_improving_layout");
	IupSetCallback(button, "ACTION", (Icallback)btn_exit_cb);
	IupShowXY(dlg, IUP_CENTER, IUP_CENTER);	
	IupMainLoop();
	IupClose();
	return EXIT_SUCCESS;
}
